<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="<%=Config.getWebPath()%>/css/ext-all.css" />
		<script type="text/javascript"	src="<%=Config.getWebPath()%>/js/ext/ext-base.js"></script>
	    <script type="text/javascript" src="<%=Config.getWebPath()%>/js/ext/ext-all.js"></script>			
	</head>
<!--********************* Part2:Java Code *********************-->

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<script language=javascript>

<%
WarehouseProductViewSearchEvent event = (WarehouseProductViewSearchEvent)context.getSessionValue("WarehouseProductViewSearchEvent");

ObjectList warehouseList = (ObjectList)context.getSessionValue("WarehouseListDetail");

String uiListDataTR_My1 = "<tr align='center' height=\"24\"  bgcolor=\"#FFFF37\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#FFFF37\"'";
String uiListDataTR_My2 = "<tr align='center' height=\"24\"  bgcolor=\"#FFA042\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#FFA042\"'";     
String uiListDataTR_My3 = "<tr align='center' height=\"24\"  bgcolor=\"#FF5809\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#FF5809\"'";
String uiListDataTR_My4 = "<tr align='center' height=\"24\"  bgcolor=\"#800080\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#800080\"'";
String []uiListDataTR_My = new String[]{uiListDataTR_My1, uiListDataTR_My2, uiListDataTR_My3,uiListDataTR_My4}; 

String msg = (String)session.getAttribute("MSG");
session.removeAttribute("MSG");

if(msg != null){
%>
    alert("<%=msg%>");
<%
}
%>

var list_code = "listProductTaxMessage";


function process(val)
{
	var warehouseCode = $.jstree._reference("#warehouseLevel").get_checked();
	var warehouseList = new Array();
	 var i = 0;
	 $.each(warehouseCode, function() {
	           warehouseList[i] =($(this).attr("id"));
	           i++;
	 });
    SetValue("title","18");
    SetValue("providerName",GetValue("i_ProviderName"));
    SetValue("warehouseCode",warehouseList);
    //SetValue("needAll",GetValue("i_needAll"));
    SetValue("balanceMode",GetValue("i_BalanceMode"));
    //仓库判断
   // if(GetValue("i_WarehouseCode").length<= 4){
    //    alert("请指定一个仓库");
   //     return false;
   // }
    //供应商判断
    //if(GetValue("i_needAll") != "yes" && GetValue("i_ProviderName") == ""){
    //    alert("请选择供应商");
    //    return false;
    //}
    if(val == '1'){
        SetValue("begindate",GetValue("i_Year"));
        SetValue("enddate",GetValue("i_Month"));
        SetValue("querytype","1");
    }
    frm.action = "<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportTaxMessage") %>";
    frm.submit();
}
//供应商选择后处理
function onSelectProvider(obj)
{
    SetValue("providerName", obj.Name);
    document.all.i_ProviderName.value = obj.Name;
}


</script>
<script type="text/javascript" src = "<%=Config.getWebPath()%>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src = "<%=Config.getWebPath()%>/js/jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="<%=Config.getWebPath()%>/css/themes/default/style.css"/>
<script type="text/javascript">
	   $(function() {
		    $("#warehouseLevel").jstree({
		        "plugins" : [ "themes", "html_data", "checkbox", "ui" ]
		       
		    });
		    
		    var checkedWarehouseCodes = "<%=event.getWarehouseTreeCodes()[0]%>";
		    
		    if(checkedWarehouseCodes == "") checkedWarehouseCodes = "00";
		    
		    var arrayCheckedWarehouseCodes = checkedWarehouseCodes.split(",");
		   
		   		  	
		  	var checkSel = function(ary, val) {
		  		for(var i=0; i<ary.length; i++) {
		  			if(ary[i] == val) {
		  				return true;
		  			}
		  		}
		  		
		  		return false;
		  	}
	

		  
		  
		});
			
</script>

<%=uiBody%>>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="providerName" value="">
<input type=hidden name="warehouseCode" value="">
<input type='hidden' name='begindate' value="">
<input type='hidden' name='enddate' value="">
<input type='hidden' name='querytype' value="">
<input type='hidden' name='title' value="">
<input type='hidden' name='needAll' value="">
<input type='hidden' name='balanceMode' value="">
<input type=hidden name="warehouseCode" value="<%=event.getWarehouseTreeCodes()[0]%>" > 
<!--查询条件保留区域-->


<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
    int key_tab = 1 ;
%>

<table id=listTable cellpadding='1' cellspacing='1' width='100%' class='data_line'><thead class='data_th'>

<tr align='center' height='24'>

    <td colspan = "2">开票信息报表</td></tr>

    
<tbody class='data_tb'>
    <tr height="24"  bgcolor="#EBEEF3">
    	<tr height="24"  bgcolor="#EBEEF3">
        <td >
         	选择仓库：    
            <div id="warehouseLevel" style="background-color: DEE4E9">
				<%=Warehouse.getWarehouseTree(warehouseList,event.getWarehouseCodes())%>
			</div>
        </td>

    </tr>
    <tr>
        <td colspan = "2">
        <!--  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓库选择：-->
        
        &nbsp;&nbsp;结算模式：        <select name="i_BalanceMode" style="width: 100px">
        							<option value='0' selected="selected">全部</option>
        							<option value='1'>压库</option>
        							<option value='2'>买断</option>
        						</select>
        &nbsp;&nbsp;供应商：<input type="text" class="texts" name="i_ProviderName" size="20" value="" key_tab="<%=key_tab++%>">
        <input type=button class=buttons value="选择" onclick="bizSelectProvider(false);return false">
        </td>
    </tr>

    <tr height="24"  bgcolor="#FFFFFF">

        <td >&nbsp;选择结算月份：<%=SelectManager.viewYearSelect(con,"i_Year","2008",false,"","-请选择-","","")%>  <%=SelectManager.viewMonthSelect(con,"i_Month","01",false,"","-请选择-","","")%></td>

        <td >
            <input type="button" name="button1" class='buttons' value="生成报表" onclick='process(1)'>
        </td>
    </tr>

    
</tbody> 

</table>


<%=uiSearchEnd%>

</form>


<%@ include file="/framework/foot.jsp"%>